<?php
class Dictionary extends CI_Model {

	var $table_name = 'system_dictionary';
    
	function get_entry_by_id($id)
    {
    	$this->db->where('id', $id);
    	
    	$query = $this->db->get($this->table_name);
    	if ($query->num_rows() == 1) return $query->row();
    	
    	return NULL;
    }
    
    function get_entry_by_reftype_value($reftype, $value)
    {
    	$this->db->where('reftype', $reftype);
    	$this->db->where('value', $value);
    	
    	$q = $this->db->get($this->table_name);

    	if ($query->num_rows() > 0) return $query->row();
    	
    	return NULL;
    }
}
?>